public class Solution2315 {
    public int countAsterisks(String s) {
        int start=0;
        int ans=0;
        for (char c : s.toCharArray()) {
            if (c=='*' && start==0){
                ans++;
            }else if (c=='|'){
                start=1-start;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution2315().countAsterisks("l|*e*et|c**o|*de|"));
    }
}
